class Solution:
    def spellchecker(self, wordlist: List[str], queries: List[str]) -> List[str]:
        origin = set(wordlist)
        lower_to_origin = {}
        vowel_to_origin = {}#模糊匹配
        trans = str.maketrans("aeiou", "?????")# 替换元音为 '?'

        for s in reversed(wordlist):
            lower = s.lower()
            lower_to_origin[lower] = s 
            vowel_to_origin[lower.translate(trans)] = s # 例如 k?t? -> KiTe
        
        for i, q in enumerate(queries):
            if q in origin:
                continue
            lower = q.lower()
            if lower in lower_to_origin:
                queries[i] = lower_to_origin[lower]
            else:
                queries[i] = vowel_to_origin.get(lower.translate(trans), "")
        return queries